#ifndef __M_LAYOUT_H__
#define __M_LAYOUT_H__

#include "gui/gui.h"

typedef View Layout;

#define LayoutSetLayoutGravity(layout, gravity) ViewSetLayoutGravity(layout, gravity)
#define LayoutGetLaoyoutGravity(layout) ViewGetLaoyoutGravity(layout)

#define LayoutSetLayoutMargin(layout, left, right, top, bottom) ViewSetLayoutMargin(layout, left, right, top, bottom)
#define LayoutGetLayoutMargin(layout, left, right, top, bottom) ViewGetLayoutMargin(layout, left, right, top, bottom)

#define LayoutSetLayoutSize(layout, layout_w, layout_h) ViewSetLayoutSize(layout, layout_w, layout_h)
#define LayoutGetLayoutSize(layout, layout_w, layout_h) ViewGetLayoutSize(layout, layout_w, layout_h)

#define LayoutSetLayoutAvailableSize(layout, available_w, available_h) ViewSetLayoutAvailableSize(layout, available_w, available_h)
#define LayoutGetLayoutAvailableSize(layout, available_w, available_h) ViewGetLayoutAvailableSize(layout, available_w, available_h)

#define LayoutSetLayoutPosition(layout, layout_x, layout_y) ViewSetLayoutPosition(layout, layout_x, layout_y)
#define LayoutGetLayoutPosition(layout, layout_x, layout_y) ViewGetLayoutPosition(layout, layout_x, layout_y)

#define LayoutSetVisibility(layout, visibility) ViewSetVisibility(layout, visibility)
#define LayoutGetVisibility(layout) ViewGetVisibility(layout)

#define LayoutSetOrientation(layout, orientation) ViewSetOrientation(layout, orientation)
#define LayoutGetOrientation(layout) ViewGetOrientation(layout)

#define LayoutSetGravity(layout, gravity) ViewSetGravity(layout, gravity)
#define LayoutGetGravity(layout) ViewGetGravity(layout)

#define LayoutSetPadding(layout, left, right, top, bottom) ViewSetPadding(layout, left, right, top, bottom)
#define LayoutGetPadding(layout, left, right, top, bottom) ViewGetPadding(layout, left, right, top, bottom)

#define LayoutSetAutoFree(layout, auto_free) ViewSetAutoFree(layout, auto_free)
#define LayoutIsAutoFree(layout) ViewIsAutoFree(layout)

#define LayoutSetFocus(view, focused) ViewSetFocus(view, focused)
#define LayoutIsFocused(view) ViewIsFocused(view)

#define LayoutSetBgColor(layout, color) ViewSetBgColor(layout, color)
#define LayoutGetBgColor(layout) ViewGetBgColor(layout)

#define LayoutSetData(layout, data) ViewSetUserData(layout, data)
#define LayoutGetData(layout) ViewGetUserData(layout)

#define LayoutGetMeasuredSize(layout, measured_w, measured_h) ViewGetMeasuredSize(layout, measured_w, measured_h)
#define LayoutGetWrapSize(layout, wrap_w, wrap_h) ViewGetWrapSize(layout, wrap_w, wrap_h)
#define LayoutGetOccupySize(layout, occupy_w, occupy_h) ViewGetOccupySize(layout, occupy_w, occupy_h)
#define LayoutGetMeasuredContentSize(layout, measured_content_w, measured_content_h) ViewGetMeasuredContentSize(layout, measured_content_w, measured_content_h)
#define LayoutGetWrapContentSize(layout, wrap_content_w, wrap_content_h) ViewGetWrapContentSize(layout, wrap_content_w, wrap_content_h)

int LayoutAddView(Layout *layout, View *view);
int LayoutAddViewAbove(Layout *layout, View *view, View *above);
int LayoutAddViewBelow(Layout *layout, View *view, View *below);
int LayoutRemoveView(Layout *layout, View *view);
int LayoutEmptyViews(Layout *layout);

Layout *NewLayout();
int LayoutInit(Layout *layout);
int LayoutDeinit(Layout *layout);
int LayoutDestroy(Layout *layout);
int LayoutMeasure(Layout *layout);
int LayoutDraw(Layout *layout);

#endif
